package com.easy.component.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * 描述: {描述}
 * 作者:
 * 创建日期: 2017/11/2 10:14
 * 修改日期: 2017/11/2
 * 版本: {版本}
 */
public class NetworkUtils {
    public NetworkUtils() {
    }

    public static Boolean checkNetworkConnect(Context context) {
        if (context != null) {
            ConnectivityManager mConnectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            NetworkInfo mNetworkInfo = mConnectivityManager.getActiveNetworkInfo();
            if (mNetworkInfo != null) {
                return Boolean.valueOf(mNetworkInfo.isAvailable());
            }
        }

        return Boolean.valueOf(false);
    }
}
